<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //键盘事件对象中的keyCode属性可以得到相应键的ASCII码值
        document.addEventListener('keyup',function(e){
            // console.log(e.keyCode);
            //1.我们的keyup和keydown事件不区分大小写a和A得到的都是65
            //2.keypress区分大小写
            //我们可以利用keycode返回的ascii码值来判断用户按下了那个键

        });
        document.addEventListener('keypress',function(e){
            console.log(e.keyCode);
        });
    </script>
</body>
</html>